<template>
  <el-card>
    <template #header>
      <div class="flex">
        <div class="flex1">投诉详情</div>
      </div>
    </template>
    <el-form
      ref="formRef"
      v-loading="loading"
      :model="data"
      label-width="130px"
      class="page"
    >
      <el-form-item label="所属机构" prop="organizationId">
        {{ data?.organizationName }}
      </el-form-item>
      <el-form-item label="问题和意见" prop="organizationId">
        {{ data?.feedback }}
      </el-form-item>
      <el-form-item label="反馈图片" prop="realName">
        <el-image
          style="display: inline-block; width: 300px; margin-bottom: 4px"
          v-for="item in data?.imageUrl || []"
          :src="item.imageUrl"
          :key="item.imageUrl"
          :preview-src-list="(data?.imageUrl || []).map(item => item.imageUrl)"
          hide-on-click-modal
        />
      </el-form-item>
      <el-form-item label="联系方式" prop="sex">
        {{ data?.recipientsPhone }}
      </el-form-item>
      <el-form-item label="反馈人" prop="phone">
        {{ data?.userName }}
      </el-form-item>
      <el-form-item label="反馈时间" prop="countryName">
        {{ data?.createTime }}
      </el-form-item>
      <el-form-item label="" prop="status">
        <el-button @click="$router.back()" type="primary">我知道了</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>
<script lang="ts" setup>
import API from '@/api/api';
import { useMessage } from '@/hooks/useMessage';
import { useRequest } from 'vue-hooks-plus';
const route = useRoute();
const message = useMessage(); // 消息弹窗
const { data, loading } = useRequest(
  async () => {
    return API.feedbackController.info({
      id: route.query.id,
    });
  },
  {
    ready: !!route.query.id,
  }
);
</script>
